Package edu.uky.ai.lp.logic
Class Fact
java.lang.Object
edu.uky.ai.lp.logic.Fact
- All Implemented Interfaces:
Expression,Formula
public class Fact extends java.lang.Object implements Expression
A fact is an individual atomic logical statement in function-free predicate
logic.
- Author:
- Stephen G. Ware
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object other)Factsubstitute(Unifier unifier)Return a version of this formula with its variables replaced with the values assigned to them by a unifier.java.lang.StringtoString()Unifierunify(Formula other, Unifier unifier)Unify this formula with another formula, adding to a given unifier as needed to make the two expression the same.
-
Field Details
-
Constructor Details
-
Fact
Constructs a new fact with the given predicate and terms.- Parameters:
predicate- the predicateterms- the terms
-
-
Method Details
-
equals
public boolean equals(java.lang.Object other)- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
unify
Description copied from interface:FormulaUnify this formula with another formula, adding to a given unifier as needed to make the two expression the same. The unifier passed in as an argument will not be modified; the (possibly extended) unifier is be returned by this method. -
substitute
Description copied from interface:FormulaReturn a version of this formula with its variables replaced with the values assigned to them by a unifier.- Specified by:
substitutein interfaceExpression- Specified by:
substitutein interfaceFormula- Parameters:
unifier- the unifier- Returns:
- the formula with variables replaced
-